<!--
	创建者：luyiming
	该文件用于：
	创建时间：2020-03-06 21:46:01
-->
<template>
	<div id="RCIM-sourceDeclaration_view">
		<el-row style="margin-bottom: 20px;">
			<el-col :span="16" style="line-height:33px;">
				<el-date-picker
					size="small"
					v-model="timeParam"
					type="daterange"
					range-separator="至"
					start-placeholder="开始日期"
					end-placeholder="结束日期"
				>
				</el-date-picker>
				<el-radio v-model="listQuery.type" label="1" style="margin-left: 20px;">放射源</el-radio>
 				<el-radio v-model="listQuery.type" label="2">射线装置</el-radio>
			</el-col>
			<el-col :span="8" style="text-align: right">
				<el-button
					size="small"
					type="primary"
					icon="el-icon-search"
					@click="search"
					class="btn-span"
					>查询</el-button
				>
				<el-button
					size="small"
					type="primary"
					icon="el-icon-plus"
					@click="addReport"
					>申报</el-button
				>
			</el-col>
		</el-row>
		<Table
			:tableData="tableData"
			:tableHead="tableHead"
			:isUseSlot="false"
			:page="listQuery.page"
			:limit="listQuery.limit"
			v-loading="listLoading"
		>
			<template slot="tool" slot-scope="{ data }">
				<el-button
					style="padding:3px;"
					icon="el-icon-document"
					@click="handleFind(data.row)"
					v-if="!data.row.disEdit"
					type="text"
					>查看</el-button
				>
				<el-button
					style="color:red;padding:3px;"
					v-if="data.row.status === 1"
					icon="el-icon-edit"
					@click="handleEdit(data.row)"
					type="text"
					>编辑</el-button
				>
			</template>
		</Table>
		<Pagination
			v-show="total > 0"
			:total="total"
			:page.sync="listQuery.page"
			:limit.sync="listQuery.limit"
			@pagination="getList"
		></Pagination>

		<el-dialog
			:visible.sync="dialogFormVisible"
			width="600px"
			:before-close="handleClose"
			destroy-on-close
		>
			<report-table
				:sourceTable="sourceForm"
				ref="reportSource"
				:reportTitle="reportSourceTitle"
				:isReadOnly="isReadOnly"
				:ruleForm="sourceRule"
				v-if="isShowSourceReport"
			>
				<template slot="explain">
					{{info.source1}}<br/>
					{{info.source2}}
				</template>
			</report-table>
			<report-table
				:sourceTable="deviceForm"
				ref="reportDevice"
				:reportTitle="reportDeviceTitle"
				:isReadOnly="isReadOnly"
				:ruleForm="deviceRule"
				v-if="isShowDeviceReport"
			>
				<template slot="explain">
					{{info.device1}}
					<br/>
					{{info.device2}}
				</template>
			</report-table>
			<span slot="footer" class="dialog-footer" v-if="isShowSourceReport || isShowDeviceReport">
				<el-button @click="handleClose">取 消</el-button>
				<el-button type="primary" @click="submitReport"
					>确 定</el-button
				>
			</span>
		</el-dialog>
	</div>
</template>

<script>
import RcimSourceDeclaration from "./index.js";
export default RcimSourceDeclaration;
</script>

<style lang="scss" scoped>
@import "./index.scss";
</style>
